<?php 
/**
 * Organization form page. Used in create and update action in OrganizationController.
 *
 * @package   views
 * @subpackage organization
 * @since     1.0
 * @filesource
 */
?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'organization-form',
	'enableAjaxValidation'=>true,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'contactPerson'); ?>
		<?php echo $form->textField($model,'contactPerson',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'contactPerson'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'contactNumber'); ?>
		<?php echo $form->textField($model,'contactNumber',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'contactNumber'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'address'); ?>
		<?php echo $form->textArea($model,'address',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'address'); ?> 
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'website'); ?>
		<?php echo $form->textField($model,'website',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'website'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'modelRefNumber'); ?>
		<?php echo $form->textField($model,'modelRefNumber',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'modelRefNumber'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'amplifierBrandModel'); ?>
		<?php echo $form->textField($model,'amplifierBrandModel',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'amplifierBrandModel'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'adcBrandModel'); ?>
		<?php echo $form->textField($model,'adcBrandModel',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'adcBrandModel'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'licenseTerm'); ?>
		<?php echo $form->textArea($model,'licenseTerm',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'licenseTerm'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'uploadFolder'); ?>
		<?php Yii::app()->clientScript->registerCoreScript('jquery');?>
		<?php echo $form->textField($model,'uploadFolder',array('size'=>60,'maxlength'=>255,'onchange'=>'$("#organization_upload_folder_preview").html($(this).val())')); ?>
		<?php echo $form->error($model,'uploadFolder'); ?>
		<div class="hint">All uploaded files for this organization will be placed into 
		<?php echo GlobalConfiguration::getByKey('UPLOAD_ROOT_FOLDER').DIRECTORY_SEPARATOR;?><span id="organization_upload_folder_preview"><?php 
		echo $model->uploadFolder;?></span>
		</div>
	</div>

	<div class="row">
		<?php 
		if (!$model->isNewRecord) {
			echo $form->labelEx($model,'active');
			echo $form->checkBox($model, 'active');
		}
		?>
	</div>
	
	<div class="row">
		<?php 
		if (!$model->isNewRecord) {
			echo $form->labelEx($model,'createTime');
			echo $model->createTime;
		}
		?>
	</div>	

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>
</div><!-- form -->